Published: Nov 11, 2023—2 min read

Ultimate Presence Detection Sensor for Your Dashboard

Written by: Fixt
Ultimate Presence Dectection Sensor Image

Prerequisites

Level Up Presence Detection Tutorial
Espresense Tutorial
Espresense Music Follow Tutorial

Sensor Template

config/configuration.yaml

sensor:
  - platform: template
    sensors:
      person_status:
        value_template: >
          {% set person = 'person.name' %}
          {% set status_dropdown = 'input_select.person_status_dropdown' %}
          {% set status_ble = 'input_select.person_ble_dropdown' %}
          {% if (is_state(person, 'not_home') and is_state(status_ble, 'Away')) or is_state(status_dropdown, 'Just Arrived') %}
            {{ states(status_dropdown) }}
          {% elif is_state(status_ble, 'Away') %}
            {% if is_state(person, 'home') %}
              Home
            {% else %}
              {{ states(person) }}
            {% endif %}
          {% else %} 
            {{ states(status_ble) }}
          {% endif %}
        entity_picture_template: /local/image.jpg
        friendly_name: 'Name'

Use it in your Dashboard

Mushroom Card By Paul Bottein

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Mushroom Template Card

Primary Information

{{states.sensor.person_status.name}}

Secondary Information

{{states.sensor.person_status.state}}

Badge Icon

{% if is_state('person.name', 'home') %}
  mdi:home 
{% endif %}

Create Zones

Open your Home Assistant instance and show your zones.

I would love to hear your comments, or suggestions on this post.


Avatar of Fixt

Fixt is a Software Engineer passionate about making the world a better place through technology and automation.